package kr.hkit.powerjava.chapter21;

public class ArrayError {

	public static void main(String[] args) {
		int[] arr = { 1, 2, 3, 4, 5 };
		
		int i =0;
		
		try{
			for(; i<=arr.length; i++){
				System.out.print(arr[i] + "\t");
			}
		}catch(ArrayIndexOutOfBoundsException e){
			System.out.println("인덱스 " + i + "사용불가 에러코드: " + e.getMessage());
			e.printStackTrace();//에러내용 출력
		}
	}
}
